<template>
  <div>
    <h1>路由基本使用</h1>
    <button @click="goForward">前进</button>
    <button @click="goBack">后退</button>
    <button @click="go">go</button>
  </div>
</template>

<script>
export default {
  methods: {
    goBack() {
      console.log("back");
      this.$router.back();
      this.$router.go(-1)
    },
    goForward() {
      console.log("forward");
      this.$router.forward();
      // this.$router.go(1)
    },
    go() {
      console.log("go");
      this.$router.go(2);
    },
  },
};
</script>
